package test.net.heartbeat.source;

import net.heartbeat.heartbeats.fixed.FixedHeartbeat;
import net.heartbeat.heartbeats.fixed.FixedHeartbeatMaker;
import net.heartbeat.heartbeats.fixed.FixedHeartbeatTransferer;
import net.heartbeat.source.HeartbeatSource;
import net.heartbeat.source.senders.TcpSender;

public class DemoHeartbeatSender_tcp {
	public static void main(String[] args) {
		final String CONTENT = "心跳";
		final String TARGET_IP = "127.0.0.1";
		final int TARGET_PORT = 8086;
		final long PERIOD = 1;// 发送周期（单位：秒）

		HeartbeatSource<FixedHeartbeat> sender = new HeartbeatSource<>(new FixedHeartbeatMaker(CONTENT),
				new FixedHeartbeatTransferer(), new TcpSender(TARGET_IP, TARGET_PORT), PERIOD);
		sender.start();
	}
}
